﻿using System.Collections.Generic;
using System;

namespace IOA.MES.DataAccess.VModel
{
    /// <summary>
    /// 入库检
    /// </summary>
    public class VInboundInspectInfo
    {
        private string _packBatchNo = string.Empty;
        private string _packNo = string.Empty;
        private string _orderNo = string.Empty;
        private string _workOrderNo = string.Empty;
        private string _cnInspectBy = string.Empty;
        private string _workshopCode = string.Empty;
        private string _workshopName = string.Empty;

        #region Public Property

        /// <summary>
        /// 主键
        /// </summary>
        public int PkId { get; set; }

        ///<Summary>
        /// 车间代码
        ///</Summary>
        public string WorkshopCode
        {
            get { return string.IsNullOrWhiteSpace(_workshopCode) ? string.Empty : _workshopCode; }
            set { _workshopCode = value; }
        }

        ///<Summary>
        /// 车间名称
        ///</Summary>
        public string WorkshopName
        {
            get { return string.IsNullOrWhiteSpace(_workshopName) ? string.Empty : _workshopName; }
            set { _workshopName = value; }
        }

        ///<Summary>
        /// 订单号
        ///</Summary>
        public string OrderNo
        {
            get { return string.IsNullOrWhiteSpace(_orderNo) ? string.Empty : _orderNo; }
            set { _orderNo = value; }
        }

        ///<Summary>
        /// 工单号
        ///</Summary>
        public string WorkOrderNo
        {
            get { return string.IsNullOrWhiteSpace(_workOrderNo) ? string.Empty : _workOrderNo; }
            set { _workOrderNo = value; }
        }

        ///<Summary>
        /// 打包批次号
        ///</Summary>
        public string PackBatchNo
        {
            get { return string.IsNullOrWhiteSpace(_packBatchNo) ? string.Empty : _packBatchNo; }
            set { _packBatchNo = value; }
        }

        ///<Summary>
        /// 打包编号
        ///</Summary>
        public string PackNo
        {
            get { return string.IsNullOrWhiteSpace(_packNo) ? string.Empty : _packNo; }
            set { _packNo = value; }
        }

        ///<Summary>
        /// 设备ID
        ///</Summary>
        public int MachineId { get; set; }

        ///<Summary>
        /// 班次ID
        ///</Summary>
        public int DutyId { get; set; }

        ///<Summary>
        /// 打包状态
        ///</Summary>
        public Enum.PackStatus PackStatus { get; set; }

        ///<Summary>
        /// 打包状态
        ///</Summary>
        public string CNPackStatus
        {
            get { return !System.Enum.IsDefined(typeof(Enum.PackStatus), PackStatus) ? string.Empty : EnumConvert.ToDesc(PackStatus); }
        }

        ///<Summary>
        /// 入库检状态
        ///</Summary>
        public Enum.PackInboundInspectStatus PackInspectStatus { get; set; }

        ///<Summary>
        /// 入库检状态
        ///</Summary>
        public string CNPackInspectStatus
        {
            get { return !System.Enum.IsDefined(typeof(Enum.PackInboundInspectStatus), PackInspectStatus) ? string.Empty : EnumConvert.ToDesc(PackInspectStatus); }
        }

        ///<Summary>
        /// 检核人
        ///</Summary>
        public int InspectBy { get; set; }
        public string CNInspectBy
        {
            get { return string.IsNullOrWhiteSpace(_cnInspectBy) ? string.Empty : _cnInspectBy; }
            set { _cnInspectBy = value; }
        }

        ///<Summary>
        /// 申请检核时间
        ///</Summary>
        public DateTime CreateTime { get; set; }

        ///<Summary>
        /// 检核时间
        ///</Summary>
        public DateTime? InspectTime { get; set; }

        ///<Summary>
        /// 产品条码
        ///</Summary>
        public List<VPackProduct> Products { get; set; } = new List<VPackProduct>();
        #endregion

        public string InspectTimeStr { get { return InspectTime?.ToString("yyyy-MM-dd HH:mm:ss"); } }
    }
}
